{extend name="base/index"/}

{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>幻灯图片管理</li>
				</ol>
			</div>
			<h4 class="page-title">
				所有幻灯片
				<a href="javascript:;" data-toggle="modal" data-target="#new_box" id="add_slider_dig" class="btn btn-success btn-sm ml-3">创建新的幻灯片</a>
			</h4>
		</div>
	</div>
</div>
{/block}

{block name="body"}
<div class="row" id="slider_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<table class="table table-hover">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>主分类/产品分类</th>
                            <th>标题</th>
                            <th>PC端图片</th>
                            <th>移动端图片</th>
                            <th>创建时间</th>
                            <th>是否显示</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {volist name='list' id="data"}
                            <tr>
                                <td>{$data.id}</td>
                                <td>{$data.classname}</td>
                                <td>{$data.title}</td>
                                <td><img class="list_facepic preview_img" src="{$data.picurl_pc|default='/static/admin/images/nopic.png'}" /></td>
                                <td><img class="list_facepic preview_img" src="{$data.picurl_m|default='/static/admin/images/nopic.png'}" /></td>
                                <td><span class="badge badge-primary">{$data.posttime|date="Y-m-d H:i",###}</span></td>
	                            <td>
									{eq name="data.status" value="0"}
									<a href="javascript:;" attr-id="{$data.id}" attr-model="slider" attr-field="status" attr-val="1" class="badge badge-primary Fast_Action">显示</a>
									{else /}
									<a href="javascript:;" attr-id="{$data.id}" attr-model="slider" attr-field="status" attr-val="0" class="badge badge-secondary Fast_Action">不显示</a>
									{/eq}
	                            </td>
                                <td>
                                    <a href="javascript:;" class="btn btn-primary btn-sm edit_btn" attr-id="{$data.id}" data-toggle="modal" data-target="#new_box"><i class="iconfont icon-icon_compile"></i> 修改</a>
                                    <a href="javascript:;" class="btn btn-danger btn-sm Fast_Del"  attr-id="{$data.id}" attr-model="slider"><i class="iconfont icon-icon_delete_fill"></i> 删除</a>
                                </td>
                            </tr>
                        {/volist}
                    </tbody>
                </table>
				<div class="row">
					<div class="col-12" style="text-align: center;">
						{$pagelist}
					</div>
				</div>					
			</div>
		</div>
	</div>
</div>
{/block}
{block name="modal_dig"}
	<!-- END CONTAINER -->
    <!-- Modal -->
    <div class="modal fade" id="new_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog modal-full-700">
        <div class="modal-content">
          <div class="modal-header">
            <h4 class="modal-title dig_title" id="myModalLabel">创建新的幻灯片</h4>
			<button type="button" class="close" data-dismiss="modal">x</button>
          </div>
          <div class="modal-body">
                <form action="#" class="form-horizontal" id="edit_slider_frm">
                	<input type="hidden" name="id" value="" />
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">选择所属主分类：</label>
                        <div class="col-5">
                            <select class="form-control" tabindex="1" name="classid">
                                <option value="0">默认分类</option>
								{$cats_tree}                                
                            </select>
                        </div>
                    </div>           
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">幻灯片标题：</label>
                        <div class="col-5">
                            <input type="text" name="title" placeholder="请输入幻灯片标题" class="form-control ipt_check" data-type="string" data-len="1-100" nullmsg="幻灯片标题不能为空" errormsg="幻灯片标题由1-100个字符组成！"  value="">
                        </div>
						<div class="col-2">
							<span class="font-13 text-muted">必填</span>
						</div>
                    </div>
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">幻灯片子标题：</label>
                        <div class="col-5">
                            <input type="text" name="stitle" placeholder="请输入幻灯片子标题/APP端输入产品编号" class="form-control">
                        </div>
						<div class="col-2">
							<span class="font-13 text-muted">必填</span>
						</div>
                    </div>
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">幻灯片链接地址：</label>
                        <div class="col-5">
                            <input type="text" name="linkurl" placeholder="请输入幻灯片链接地址" class="form-control">
                        </div>
                    </div>
	                <div class="form-group row mb-1">
	                    <label class="col-3 col-form-label">PC图片上传：</label>
	                    <div class="col-5 picurl_pc_box">
		                    <div class="picurl_pc" data-type="upload" attr-inputname="picurl_pc" nullmsg="PC图片没有上传" attr-value=""  isCompress="1"></div>
	                    </div>
	                </div>
	                <div class="form-group row mb-1">
	                    <label class="col-3 col-form-label">移动端图片上传：</label>
	                    <div class="col-5 picurl_m_box">
		                    <div class="picurl_m" data-type="upload" attr-inputname="picurl_m" nullmsg="移动端图片没有上传" attr-value=""  isCompress="1"></div>
	                    </div>
	                </div>
                    <div class="form-group row mb-1">
                        <label class="col-3 col-form-label">幻灯片描述：</label>
                        <div class="col-5">
                            <textarea class="medium form-control" name="description" rows="3"></textarea>
                        </div>
                    </div>
	                <div class="form-group row mb-1">
	                    <label class="col-3 col-form-label">是否显示：</label>
	                    <div class="col-5">
							<div class="custom-control custom-radio">
								<input type="radio" name="status" id="status1" class="custom-control-input" value="0" checked="checked">
								<label class="custom-control-label" for="status1">显示</label>
							</div>
							<div class="custom-control custom-radio">
								<input type="radio" name="status" id="status2" class="custom-control-input" value="1">
								<label class="custom-control-label" for="status2">不显示</label>
							</div>  
	                    </div>
	                </div>                    
                </form>
          </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            <button type="button" class="btn btn-primary Fast_Form_Post" attr-frm="#edit_slider_frm" attr-callback="reload" attr-model="slider" attr-active="save_slider">保存</button>
          </div>
        </div>
      </div>
    </div>
{/block}